<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>LCV Framework: test-bmp.c Quellcode</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Erzeugt von Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Hauptseite</span></a></li>
    <li><a href="classes.html"><span>Datenstrukturen</span></a></li>
    <li class="current"><a href="files.html"><span>Dateien</span></a></li>
  </ul>
</div>
<h1>test-bmp.c</h1><a href="test-bmp_8c.html">gehe zur Dokumentation dieser Datei</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include "<a class="code" href="bmp_8h.html" title="Funktionen zum Schreiben und lesen des Bitmap Headers.">lcv/bmp.h</a>"</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include "<a class="code" href="config_8h.html">config.h</a>"</span>
<a name="l00005"></a>00005 
<a name="l00006"></a><a class="code" href="test-bmp_8h.html#c01b2ad3ad4c214ad7ea7607abdd391a">00006</a> <span class="keywordtype">void</span> <a class="code" href="test-bmp_8c.html#c01b2ad3ad4c214ad7ea7607abdd391a" title="Testet die bmp library des LCV-Frameworks.">test_bmp</a>()
<a name="l00007"></a>00007 {
<a name="l00008"></a>00008         <span class="keywordtype">int</span> i;
<a name="l00009"></a>00009         
<a name="l00010"></a>00010         printf(<span class="stringliteral">"reading bmp... "</span>);
<a name="l00011"></a>00011         fflush(stdout);
<a name="l00012"></a>00012         <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> p_from_bmp = <a class="code" href="bmp_8c.html#db9d72348ad074e3aa31306fd9c0f410" title="Liest ein Bitmap vom Dateisystem ein und wandelt es in ein lcv_picture um.">lcv_read_bmp</a>(<a class="code" href="config_8h.html#3d3267b8ecabd35fd473c13d616e53d9">FULLSIZE_INPUT_IMAGE</a>);
<a name="l00013"></a>00013         printf(<span class="stringliteral">"ok\n"</span>); 
<a name="l00014"></a>00014         
<a name="l00015"></a>00015         printf(<span class="stringliteral">"writing bmp... "</span>);
<a name="l00016"></a>00016         fflush(stdout);
<a name="l00017"></a>00017         <a class="code" href="bmp_8c.html#460186983c9e59d93ee69a459c5d0815" title="Speichert ein lcv_picture Strukt im BMP-Format ab.">lcv_write_bmp</a>(p_from_bmp, <span class="stringliteral">"bmp_test.bmp"</span>);
<a name="l00018"></a>00018         printf(<span class="stringliteral">"ok\n"</span>); 
<a name="l00019"></a>00019         
<a name="l00020"></a>00020         printf(<span class="stringliteral">"comparing the images... "</span>);
<a name="l00021"></a>00021         fflush(stdout);
<a name="l00022"></a>00022         <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> p_from_bmp2 = <a class="code" href="bmp_8c.html#db9d72348ad074e3aa31306fd9c0f410" title="Liest ein Bitmap vom Dateisystem ein und wandelt es in ein lcv_picture um.">lcv_read_bmp</a>(<span class="stringliteral">"bmp_test.bmp"</span>);
<a name="l00023"></a>00023         
<a name="l00024"></a>00024         <span class="keywordflow">if</span>(p_from_bmp2.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> == p_from_bmp.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> &amp;&amp; 
<a name="l00025"></a>00025            p_from_bmp2.<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a>  == p_from_bmp.<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a> &amp;&amp; 
<a name="l00026"></a>00026            p_from_bmp2.<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a> == p_from_bmp.<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a> &amp;&amp; 
<a name="l00027"></a>00027            p_from_bmp2.<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a>   == p_from_bmp.<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a>){
<a name="l00028"></a>00028            
<a name="l00029"></a>00029            <span class="keywordflow">for</span>(i=0; i&lt;p_from_bmp.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>; i++){
<a name="l00030"></a>00030                 <span class="keywordflow">if</span>(p_from_bmp2.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i] != p_from_bmp.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i]){
<a name="l00031"></a>00031                         printf(<span class="stringliteral">"\nError: images are not equal\n"</span>);
<a name="l00032"></a>00032                         printf(<span class="stringliteral">"Aborting Test\n"</span>);
<a name="l00033"></a>00033                         exit(-1);
<a name="l00034"></a>00034                 }
<a name="l00035"></a>00035            }
<a name="l00036"></a>00036            
<a name="l00037"></a>00037         }<span class="keywordflow">else</span>{
<a name="l00038"></a>00038                 printf(<span class="stringliteral">"\nError: images-parameters are not equal\n"</span>);
<a name="l00039"></a>00039                 printf(<span class="stringliteral">"Aborting Test\n"</span>);
<a name="l00040"></a>00040                 exit(-1);
<a name="l00041"></a>00041         }
<a name="l00042"></a>00042                 
<a name="l00043"></a>00043         printf(<span class="stringliteral">"ok\n"</span>); 
<a name="l00044"></a>00044 }
</pre></div><hr size="1"><address style="text-align: right;"><small>Erzeugt am Thu Dec 13 14:01:49 2007 für LCV Framework von&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>
